using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Tilemaps;

namespace ns
{
    ///<summary>
    ///
    ///</summary>
    public class WalkState : FSMState
    {
        public override void Init()
        {
            StateID = FSMStateID.Walk;       
        }
        public override void EnterState(FSMBase fsm)
        {
            base.EnterState(fsm);
            fsm.animator.SetBool(fsm.chParams.walk, true);
        }
        public override void ActionState(FSMBase fsm)
        {
            base.ActionState(fsm);
            fsm.transform.Translate(Vector3.right * fsm.speed * Time.deltaTime);
            if (fsm.WaterTile==null)
            {
                fsm.transform.Translate(0, -5* Time.deltaTime, 0);
            }
        }
        public override void ExitState(FSMBase fsm)
        {
            base.ExitState(fsm);
            fsm.animator.SetBool(fsm.chParams.walk, false);
        }
    }
}
